package Day01;

interface Usb {
    void work();
}

class UsbFan implements Usb {
    @Override
    public void work() {
        System.out.println("UsbFan is working");
    }
}

class UsbMouse implements Usb {
    @Override
    public void work() {
        System.out.println("UsbMouse is working");
    }
}

public class Computer {
    private Usb usb;

    public Computer() {
    }

    public Computer(Usb usb) {
        this.usb = usb;
    }

    public void setUsb(Usb usb) {
        this.usb = usb;
    }

    public Usb getUsb() {
        return usb;
    }

    public static void main(String[] args) {
        Computer computer = new Computer();
        computer.setUsb(new UsbFan());
        computer.getUsb().work();
        computer.setUsb(new UsbMouse());
        computer.getUsb().work();
    }
}
